window.onload = function () {
    document.getElementById("music").addEventListener("play",
        function () {
            var x = document.getElementsByClassName("x");
            for (var i = 0; i < x.length; i++) {
                x[i].style = "animation-play-state: running;";
            }
        }
    );
    document.getElementById("music").addEventListener("pause",
        function () {
            var x = document.getElementsByClassName("x");
            for (var i = 0; i < x.length; i++) {
                x[i].style = "animation-play-state: paused;";
            }
        }
    );
}



